package com.project.webapp.action.front.preSchool;

import java.util.List;

import com.project.dao.bean.Resume;
import com.project.service.front.preSchool.ResumeService;
import com.project.webapp.action.BaseAction;

/**
 * 求职简历  Action
 * @author Sn
 *
 */
public class ResumeAction extends BaseAction 
{

	/**
	 * 序列化版本号
	 */
	private static final long serialVersionUID = 1L;
	private String operateResult    = "";

	private ResumeService resumeService;
	private Resume resume;
	List<Resume> resumeList;
	
	@Override
	public String execute() throws Exception 
	{
		resume = new Resume();
		if(resumeList!=null && resumeList.size()>0)
		{
			resumeList.clear();
		}
		return this.query();
	}
	
	public String showAdd() 
	{
		resume = new Resume();
        operateResult = "";
        return SUCCESS;
    }

    /**
     * 
     * <pre>
     * 查询
     * </pre>
     *
     * @return
     */
    public String query() 
    {
        return SUCCESS;
    }
    
    /**
     * 
     * <pre>
     * 保存
     * </pre>
     *
     * @return
     */
    public String save() 
    {
    	try 
    	{
    		resume.setR_bir(resume.getR_bir_y()+resume.getR_bir_m());
    		resumeService.save(resume);
    		operateResult = "suc";
    	} catch (Exception e) 
    	{
    		e.printStackTrace();
    		operateResult = "fail";
    	}
    	resume = new Resume();
    	return "suc";
    }

	public String getOperateResult() {
		return operateResult;
	}

	public void setOperateResult(String operateResult) {
		this.operateResult = operateResult;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public ResumeService getResumeService() {
		return resumeService;
	}

	public void setResumeService(ResumeService resumeService) {
		this.resumeService = resumeService;
	}

	public Resume getResume() {
		return resume;
	}

	public void setResume(Resume resume) {
		this.resume = resume;
	}

	public List<Resume> getResumeList() {
		return resumeList;
	}

	public void setResumeList(List<Resume> resumeList) {
		this.resumeList = resumeList;
	}
    
}
